{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "c1a20a47",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello word!\n"
     ]
    }
   ],
   "source": [
    "print('hello word!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "87515db0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time\n",
    "time.sleep(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "054e1c8a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "def square(x):\n",
    "    return x * x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "5324001f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 squared is 1\n"
     ]
    }
   ],
   "source": [
    "x = np.random.randint(1, 10)\n",
    "y = square(x)\n",
    "print('%d squared is %d' % (x, y))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "252138bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "def selection_sort(array):\n",
    "    for i in range(len(array)-1):\n",
    "        min_index = i\n",
    "        for j in range(i+1, len(array)):\n",
    "            if array[j] < array[min_index]:\n",
    "                min_index = j\n",
    "        if min_index != i:\n",
    "            array[i], array[min_index] = array[min_index], array[i]\n",
    "    return array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "a47eea39",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[5, 7, 10, 15, 17, 21, 24, 27, 30, 36, 45, 50]\n"
     ]
    }
   ],
   "source": [
    "array = [10, 17, 50, 7, 30, 24, 27, 45, 15, 5, 36, 21]\n",
    "print(selection_sort(array))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "23f8836f",
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "fb28f47c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('fortune500.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "fa1778f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Rank</th>\n",
       "      <th>Company</th>\n",
       "      <th>Revenue (in millions)</th>\n",
       "      <th>Profit (in millions)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1955</td>\n",
       "      <td>1</td>\n",
       "      <td>General Motors</td>\n",
       "      <td>9823.5</td>\n",
       "      <td>806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1955</td>\n",
       "      <td>2</td>\n",
       "      <td>Exxon Mobil</td>\n",
       "      <td>5661.4</td>\n",
       "      <td>584.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1955</td>\n",
       "      <td>3</td>\n",
       "      <td>U.S. Steel</td>\n",
       "      <td>3250.4</td>\n",
       "      <td>195.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1955</td>\n",
       "      <td>4</td>\n",
       "      <td>General Electric</td>\n",
       "      <td>2959.1</td>\n",
       "      <td>212.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1955</td>\n",
       "      <td>5</td>\n",
       "      <td>Esmark</td>\n",
       "      <td>2510.8</td>\n",
       "      <td>19.1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Year  Rank           Company  Revenue (in millions) Profit (in millions)\n",
       "0  1955     1    General Motors                 9823.5                  806\n",
       "1  1955     2       Exxon Mobil                 5661.4                584.8\n",
       "2  1955     3        U.S. Steel                 3250.4                195.4\n",
       "3  1955     4  General Electric                 2959.1                212.6\n",
       "4  1955     5            Esmark                 2510.8                 19.1"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "e7a51cdd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Rank</th>\n",
       "      <th>Company</th>\n",
       "      <th>Revenue (in millions)</th>\n",
       "      <th>Profit (in millions)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>25495</th>\n",
       "      <td>2005</td>\n",
       "      <td>496</td>\n",
       "      <td>Wm. Wrigley Jr.</td>\n",
       "      <td>3648.6</td>\n",
       "      <td>493</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25496</th>\n",
       "      <td>2005</td>\n",
       "      <td>497</td>\n",
       "      <td>Peabody Energy</td>\n",
       "      <td>3631.6</td>\n",
       "      <td>175.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25497</th>\n",
       "      <td>2005</td>\n",
       "      <td>498</td>\n",
       "      <td>Wendy's International</td>\n",
       "      <td>3630.4</td>\n",
       "      <td>57.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25498</th>\n",
       "      <td>2005</td>\n",
       "      <td>499</td>\n",
       "      <td>Kindred Healthcare</td>\n",
       "      <td>3616.6</td>\n",
       "      <td>70.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25499</th>\n",
       "      <td>2005</td>\n",
       "      <td>500</td>\n",
       "      <td>Cincinnati Financial</td>\n",
       "      <td>3614.0</td>\n",
       "      <td>584</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Year  Rank                Company  Revenue (in millions)  \\\n",
       "25495  2005   496        Wm. Wrigley Jr.                 3648.6   \n",
       "25496  2005   497         Peabody Energy                 3631.6   \n",
       "25497  2005   498  Wendy's International                 3630.4   \n",
       "25498  2005   499     Kindred Healthcare                 3616.6   \n",
       "25499  2005   500   Cincinnati Financial                 3614.0   \n",
       "\n",
       "      Profit (in millions)  \n",
       "25495                  493  \n",
       "25496                175.4  \n",
       "25497                 57.8  \n",
       "25498                 70.6  \n",
       "25499                  584  "
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "aee8e8af",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.columns = ['year', 'rank', 'company', 'revenue', 'profit']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "80632371",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "25500"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "4e64ca47",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "year         int64\n",
       "rank         int64\n",
       "company     object\n",
       "revenue    float64\n",
       "profit      object\n",
       "dtype: object"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "df99227b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>rank</th>\n",
       "      <th>company</th>\n",
       "      <th>revenue</th>\n",
       "      <th>profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>228</th>\n",
       "      <td>1955</td>\n",
       "      <td>229</td>\n",
       "      <td>Norton</td>\n",
       "      <td>135.0</td>\n",
       "      <td>N.A.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>290</th>\n",
       "      <td>1955</td>\n",
       "      <td>291</td>\n",
       "      <td>Schlitz Brewing</td>\n",
       "      <td>100.0</td>\n",
       "      <td>N.A.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>294</th>\n",
       "      <td>1955</td>\n",
       "      <td>295</td>\n",
       "      <td>Pacific Vegetable Oil</td>\n",
       "      <td>97.9</td>\n",
       "      <td>N.A.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>1955</td>\n",
       "      <td>297</td>\n",
       "      <td>Liebmann Breweries</td>\n",
       "      <td>96.0</td>\n",
       "      <td>N.A.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>352</th>\n",
       "      <td>1955</td>\n",
       "      <td>353</td>\n",
       "      <td>Minneapolis-Moline</td>\n",
       "      <td>77.4</td>\n",
       "      <td>N.A.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     year  rank                company  revenue profit\n",
       "228  1955   229                 Norton    135.0   N.A.\n",
       "290  1955   291        Schlitz Brewing    100.0   N.A.\n",
       "294  1955   295  Pacific Vegetable Oil     97.9   N.A.\n",
       "296  1955   297     Liebmann Breweries     96.0   N.A.\n",
       "352  1955   353     Minneapolis-Moline     77.4   N.A."
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "non_numberic_profits = df.profit.str.contains('[^0-9.-]')\n",
    "df.loc[non_numberic_profits].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "25bcbbf3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "369"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df.profit[non_numberic_profits])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "a38529ab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD7CAYAAABzGc+QAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAN20lEQVR4nO3db4yl5VnH8e+PQqsFmoAMZEW2gw1tJLFAO0EMxqKESiERiEGhtSUpyfYFTcA0mm01sYlvaNOiMZqabaBdI9JU2wYMWMQNEWux7S7hz9KFQuuKtBsWp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XOAR9Zzn4d/00cP2xcAL1ZVq3/bQ303Anuq6oaxp24Drhq2r+KV+m8DrkjyhuG00WnANzv1+VXW+reoa3FjNKrcB/yY0f+8VwPXMvoN9neA6xkWOQ37/zbwMKNziZ8ca58Z2r4L/Nn4MYfbbQl9Pg/411leZ132GTgG+Jvh7/nbwO9ugD5PA48y+sXfPwJv7tZnRqc1i9FMsfuH20WMZovtYPSJYgdw/Ngxvz/061HGZpp06fP4zZWYktSUp1AkqSkDXJKaMsAlqSkDXJKaMsAlqSkDXJKaMsAlqSkDXJKa+j94Hj0Zaz8lrwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "bin_sizes, _, _ = plt.hist(df.year[non_numberic_profits], bins=range(1955, 2006))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "7c3af7fe",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.loc[~non_numberic_profits]\n",
    "df.profit = df.profit.apply(pd.to_numeric)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "211e8ace",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "69557e5c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
